<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            $table->increments('id');
            $table->string('order_num')->comment('订单号');
            $table->bigInteger('freight_charge')->default(0)->comment('运费 单位分');
            $table->bigInteger('total_price')->comment('订单总价 单位分');
            $table->tinyInteger('status')->default(0)->comment('订单状态 0:待付款 1:待发货 2:待收货 3:待评价');
            $table->tinyInteger('pay_way')->nullable()->comment('支付方式 1:微信支付 2:支付宝支付');
            $table->timestamp('pay_time')->nullable()->comment('支付时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('orders');
    }
}
